package com.sl.au.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.ExdeviExdePersonRoleInfo;
@Transactional(readOnly = true)
public interface ExdeviExdePersonRoleInfoRepository extends JpaRepository<ExdeviExdePersonRoleInfo, String> {
	@Query("select e.user_id from ExdeviExdePersonRoleInfo e where e.name = ?1")
	List<String> findByRole(String accountName);

	@Query("select e.user_id from ExdeviExdePersonRoleInfo e where e.name like '%'+?1+'%' and e.sSuperior=?2 ")
	List<String> findRoles(String type, String superior);

	@Query("select e.user_id from ExdeviExdePersonRoleInfo e where e.name like '%'+?1+'%' and e.sSuperior=?2 and e.sAreaName=?3 ")
	List<String> findRoles(String type, String superior, String areaName); 

}
